package org.whh.sys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.whh.base.util.QueryVo;
import org.whh.base.util.ResultDTO;
import org.whh.sys.domain.Dictionary;
import org.whh.sys.mapper.DictionaryitemMapper;
import org.whh.sys.service.IDictionaryService;
import org.whh.base.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author whh
 * @since 2023-03-13
 */
@Service
public class DictionaryServiceImpl extends BaseServiceImpl<Dictionary> implements IDictionaryService {
    @Autowired
    DictionaryitemMapper dictionaryitemMapper;
    @Override
    public void deleteById(Serializable id) {
        dictionaryitemMapper.deleteByParentId(id);
        super.deleteById(id);

    }

    @Override
    public void batchDelete(List<Long> ids) {
        for (Long id : ids) {
            dictionaryitemMapper.deleteByParentId(id);
        }
        super.batchDelete(ids);

    }
}
